package com.shopoo.oauth.infrastructure.client;

import java.util.Map;

import com.shopoo.oauth.infrastructure.client.dto.TokenResponse;
import com.shopoo.oauth.infrastructure.client.dto.UserInfoDTO;
import feign.Headers;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description 权限认证
 * @Date 2020/5/25 1:04 下午
 * @Author <a href="mailto:android_li@sina.cn">Joe</a>
 **/
@FeignClient(name = "shopoo-oauth")
public interface OauthClient {

    @PostMapping(value = "/oauth/token")
    @Headers("Content-Type: application/json;charset=UTF-8")
    TokenResponse getToken(@RequestParam Map<String, ?> tokenRequestBody);

    @GetMapping("/")
    UserInfoDTO getUserDTO();
}
